home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / PROGRAMR / GSRC208A.ZIP / DATAB.H < prev    next >
C/C++ Source or Header  |  1993-08-23  |  5KB  |  148 lines

  1. /*
  2.     GEPASI - a simulator of metabolic pathways and other dynamical systems
  3.     Copyright (C) 1989, 1992  Pedro Mendes
  4. */
  5.  
  6. /*************************************/
  7. /*                                   */
  8. /*   databases and their functions   */
  9. /*                                   */
  10. /*          MICROSOFT C 6.00         */
  11. /*           QuickC/WIN 1.0          */
  12. /*             ULTRIX cc             */
  13. /*              GNU gcc              */
  14. /*                                   */
  15. /*   (include here compilers that    */
  16. /*   compiled GEPASI successfully)   */
  17. /*                                   */
  18. /*************************************/
  19.  
  20.  
  21. /* structure holding information relative to kinetic mechanisms    */
  22.  
  23. struct kint {
  24.                   unsigned char nsub;        /* number ofsubstrates    */
  25.                 unsigned char npro;        /* number of products    */
  26.                 unsigned char nmodf;    /* number of modifiers    */
  27.                 unsigned char revers;    /* reversability        */
  28.                   unsigned char nconst;    /* number of kin. const.*/
  29.                 char *descr;            /* title                */
  30.                 char *constnam;            /* kin. constant names    */
  31.                };
  32.  
  33. /* structures for user-defined rate equations                    */
  34.  
  35. struct nodet{
  36.              char item;
  37.              unsigned char val;
  38.              unsigned char left;
  39.              unsigned char right;
  40.             } ;
  41.  
  42. struct treet{
  43.              struct nodet node[256];
  44.              char id[64][10];
  45.              float constant[32];
  46.              int nnode,
  47.                  nnum,
  48.                  nid,
  49.                  nsub,
  50.                  npro,
  51.                  nmodf,
  52.                  nconst,
  53.                  revers;
  54.              char descr[64];
  55.             } ;
  56.  
  57.  
  58. /* structure holding simulation options                            */
  59.  
  60. struct opt {
  61.             int dyn;
  62.             long pfo;
  63.             double    endtime;
  64.             double    reltol;
  65.             double    abstol;
  66.             double    hrcz;
  67.             int adams;
  68.             int bdf;
  69.             int ss;
  70.             int debug;
  71.             int txt;
  72.             int structan;
  73.             int staban;
  74.             int stdela;
  75.             int nonela;
  76.             int stdcc;
  77.             int noncc;
  78.             int dat;
  79.             char datname[PWIDTH];
  80.             int datsep;
  81.             int datwidth;
  82.             int dattit;
  83.             int datmca;
  84.             int datss;
  85.             int append;
  86.             int quotes;
  87.             char timeu[32];
  88.             char concu[32];
  89.             int scan;
  90.             int scanfill;
  91.             int scandens;
  92.             int scanlog;
  93.            };
  94.  
  95. struct sp{
  96.           PDBL var;
  97.           double low;
  98.           double high;
  99.           double ampl;
  100.           int dens;
  101.           int log;
  102.           PDBL linkedto;
  103.           double factor;
  104.           int operation;
  105.          };
  106.  
  107.  
  108. extern PDBL        params[MAX_STEP];                            /* ptr to parameters for each rate eq.    */
  109. extern int *eff[MAX_STEP];                                /* ptr to parameters for each rate eq.    */
  110. extern unsigned char    revers[MAX_STEP];                    /* 1 if reaction is reversible            */
  111. extern struct    opt options;                                /* structure with simulation options    */
  112. extern struct     kint *ktype;                                /* ptr array of kinetic types & proprt    */
  113. extern struct sp  *sparam;                                    /* ptr array with parameters to scan    */
  114. extern PDBL        *scanpar;                                    /* ptrs to all possbl.params 4 scanning */
  115. extern PDBL        *outpel;                                    /* array of ptr to values for dat output*/
  116. extern PDBL        *poutelem;                                    /* ptrs to values for actual dat output    */
  117. extern char        *outtit;                                    /* pointer to buffer with column titles */
  118. extern char        *treestr;                                    /* pointer to buffer with constant names*/
  119. extern char        *treeptr;                                    /* pointer to buffer with constant names*/
  120. extern int        *scindex;                                    /* ptr to base of array with idx to scan*/
  121. extern int        *lindex;                                    /* ptr to base of array with idx 2 links*/
  122. extern int        noutpel;                                    /* number of output elements            */
  123. extern int        nscanpar;                                   /* number of scanning elements            */
  124. extern int        totscan;                                    /* number of selected scanning params    */
  125. extern int        nlinks;                                        /* number of linked parameters            */
  126. extern int        nudf;                                        /* number of user-def functions            */
  127. extern int        nrateq;                                        /* number of total rate equations        */
  128. extern int        totsel;                                     /* number of selected output elements    */
  129. extern int        kfl[MAX_STEP];                                /* flags for kinetic types                */
  130. extern unsigned int sizespar;
  131. extern unsigned int sizeparam;
  132. extern unsigned int sizeeff;
  133. extern unsigned int sizeoutp;
  134. extern unsigned int sizetr;
  135. extern struct treet *tree;                                /* function tree for rate equations        */
  136. extern struct    treet tr;                                    /* tree for the input                    */
  137.  
  138. int MemAlloc( void );
  139. void InitDataBase( void );
  140. int SetParams( void );
  141. int SetEff( void );
  142. int SetOutpEl( void );
  143. int SetScanPar( void );
  144. int addtr( int e );
  145. int new_rateq( int idx );
  146. int new_tree( int idx );
  147. void FreeMem( void );
  148.